import axios from '@/libs/api.request'
/**
 * 添加角色
 */
export const addRoleApi = (data)=>{
  return axios.request({
    url:'/ims-admin/role/add',
    method:'post',
    data
  })
}
/**
 * 修改角色
 */
export const modifyRoleApi = (data)=>{
  return axios.request({
    url:'/ims-admin/role/modify',
    method:'post',
    data
  })
}
/**
 * 删除角色
 */
export const deleteRoleApi = (roleId)=>{
  return axios.request({
    url:'/ims-admin/role/delete/'+roleId,
    method:'get'
  })
}
/**
 * 查询角色
 */
export const queryRoleListApi = (data)=>{
  return axios.request({
    url:'/ims-admin/role/query',
    method:'post',
    data
  })
}
/**
 * 查询角色下的权限列表
 */
export const queryRightsApi = (data)=>{
  return axios.request({
    url:'/ims-admin/role/right/query',
    method:'post',
    data
  })
}
/**
 * 给角色赋予权限
 */
export const AddRightToRoleApi = (data)=>{
  return axios.request({
    url:'/ims-admin/role/right/add',
    method:'post',
    data
  })
}
/**
 * 去掉角色权限
 */
export const deleteRightToRoleApi = (id)=>{
  return axios.request({
    url:'/ims-admin/role/right/delete/'+id,
    method:'get',
  })
}
/**
 * 查询该系统下所有角色
 */
export const getRolesBySystemIdApi = (systemId)=>{
  return axios.request({
    url:'/ims-admin/role/system/list/'+systemId,
    method:'get'
  })
}

